home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
lcppb.zip
/
LCPPLIB.ZIP
/
WINDOW.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-08
|
3KB
|
91 lines
// window.h -- Header for window.cpp
#ifndef __window_H
#define __window_H 1 // Prevent multiple #includes
#include <stdlib.h>
#include "stritem.h"
#include "item.h"
/* -- window information structure */
struct winStruct {
int row; // Absolute row of top left corner
int col; // Absolute column of top left corner
int width; // Width of border
int height; // Height of border
unsigned wtattr; // window normal text attribute
unsigned wbattr; // window border attribute
unsigned whattr; // window highlight text attribute
int wtype; // Border type (0 ... 4)
};
/* -- cwindow class */
class cwindow: public item {
private:
// -- Static data field (shared by all objects of class)
static int dispInitialized; // True == display initialized
// -- Private data fields
int wbr; // window bottom row
int wrc; // window right column
int cr, cc; // Logical cursor row, cursor column
unsigned wca; // window current attribute
strItem *wtitle; // Pointer to window title strItem
unsigned *save; // If NULL, text behind not saved
// -- Protected data fields
protected:
int isOpen; // True if window is visible
winStruct ws; // Location, size, attributes
// -- Private member functions
private:
unsigned *saveBuf(void);
void commonInits(void);
void showOutline(void);
public:
// -- Static member functions
static void startup(void);
static void shutDown(void);
// -- Constructors and destructors
cwindow();
cwindow(winStruct &ws, const char *title);
~cwindow();
// -- Inline member functions
winStruct &getInfo()
{ return ws; }
void reverseVideo(void)
{ wca = ws.whattr; }
void normalVideo(void)
{ wca = ws.wtattr; }
// -- Other member functions
void showWindow();
void hideWindow();
void setTitle(const char *s);
void setInfo(winStruct &ws);
void gotorc(int row, int col);
void puts(char *s);
void scrollUp(int nrows);
void scrollDown(int nrows);
void eeol(void);
void eeow(void);
};
#endif // __window_H
// Copyright (c) 1990 by Tom Swan. All rights reserved
// Revision 1.00 Date: 09/22/1990 Time: 11:47 am
// Revision 1.01 Date: 07/08/1991 Time: 05:41 pm
// Converted for Borland C++ 2.0